// D3D9BufferManager.h

#ifndef __D3D9BUFFERMANAGER_H__
#define __D3D9BUFFERMANAGER_H__

#include <set>
#include "..\Core\Singleton.h"

class CD3D9VertexBuffer;
class CD3D9IndexBuffer;
class CD3D9BufferManager : public Singleton<CD3D9BufferManager>
{
public:
	typedef std::set<CD3D9VertexBuffer*> VertexBufferSet;
	typedef std::set<CD3D9IndexBuffer*> IndexBufferSet;
private:
	VertexBufferSet m_VertexBuffers;
	IndexBufferSet m_IndexBuffers;
	IDirect3DDevice9* m_pDevice;
public:
	CD3D9BufferManager(IDirect3DDevice9* pDevice);
	virtual ~CD3D9BufferManager();

	CD3D9VertexBuffer* CreateVertexBuffer(size_t vertexSize, size_t numVertices, DWORD dwUsage);
	CD3D9IndexBuffer* CreateIndexBuffer(D3DFORMAT indexType, size_t numIndices, DWORD dwUsage);

};

#endif